package com.usian.feign;

import com.usian.pojo.TbContent;
import com.usian.pojo.TbContentCategory;
import com.usian.utils.AdNode;
import com.usian.utils.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("usian-content-service")
public interface ContentFeign {

    @RequestMapping("selectContentCategoryByParentId")
    List<TbContentCategory> selectContentCategoryByParentId(@RequestParam Long id);

    @RequestMapping("insertContentCategory")
    Boolean insertContentCategory(@RequestParam Long parentId,@RequestParam String name);

    @RequestMapping("deleteContentCategoryById")
    void deleteContentCategoryById(@RequestParam Long categoryId);

    @RequestMapping("updateContentCategory")
    Boolean updateContentCategory(@RequestParam Long id, @RequestParam String name);

    @RequestMapping("selectTbContentAllByCategoryId")
    PageResult selectTbContentAllByCategoryId(@RequestParam Long categoryId);

    @RequestMapping("insertTbContent")
    Boolean insertTbContent(@RequestBody TbContent tbContent);

    @RequestMapping("deleteContentByIds")
    void deleteContentByIds(@RequestParam Integer[] ids);

    @RequestMapping("selectFrontendContentByAD")
    List<AdNode> selectFrontendContentByAD();
}
